//-----------------------------------------------------------------------
// <copyright file="tblParameterService.cs" company="Cyvee">
//     Copyright ? Cyvee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using Scb.Framework;
using Robot.Entities;
using Robot.Data;
    
namespace Robot.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class tblParameterService
    {
        #region tblParameter

        public static void CreatetblParameter(tblParameter tblParameter)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                tblParameterDAO.CreatetblParameter(tblParameter);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreatetblParameterException, ex);
            }
        }        

        public static void UpdatetblParameter(tblParameter tblParameter)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                tblParameterDAO.UpdatetblParameter(tblParameter);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdatetblParameterException, ex);
            }
        }        

        public static void DeletetblParameter(int id)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                tblParameterDAO.DeletetblParameter(id);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeletetblParameterException, ex);
            }
        }
        
        public static tblParameter GettblParameter(int id)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                return tblParameterDAO.GettblParameter(id);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblParameterException, ex);
            }
        }                

        public static tblParameterCollection GettblParameterList(tblParameterColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                return tblParameterDAO.GettblParameterList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblParameterListException, ex);
            }
        }        

        public static tblParameterCollection GettblParameterList(tblParameterColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                tblParameterDAO tblParameterDAO = new tblParameterDAO();
                return tblParameterDAO.GettblParameterList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblParameterListException, ex);
            }
        }        

        #endregion
    }
}